/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.wallet.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.pig4cloud.pigx.common.customize.utils.serializer.BigDecimalToPlainStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 资金账户
 *
 * @since 2022-08-12 19:28:20
 */
@Data
@TableName("capital_account")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "资金账户")
public class CapitalAccount extends Model<CapitalAccount> {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键ID
	 */
	@TableId(type = IdType.ASSIGN_ID)
	@ApiModelProperty(value = "主键ID")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;

	/**
	 * 创建人
	 */
	@ApiModelProperty(value = "创建人")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long createBy;

	/**
	 * 修改人
	 */
	@ApiModelProperty(value = "修改人")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long updateBy;

	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间")
	private LocalDateTime createTime;

	/**
	 * 修改时间
	 */
	@ApiModelProperty(value = "修改时间")
	private LocalDateTime updateTime;

	/**
	 * 逻辑删除
	 */
	@ApiModelProperty(value = "逻辑删除")
	@TableLogic
	private String delFlag;

	/**
	 * 可用
	 */
	@ApiModelProperty(value = "可用")
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal available;

	/**
	 * 冻结
	 */
	@ApiModelProperty(value = "冻结")
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal frozen;

	/**
	 * 用户ID
	 */
	@ApiModelProperty(value = "用户ID")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long userId;

	/**
	 * 币种（0：USDT）
	 */
	@ApiModelProperty(value = "币种（1：USDT）")
	private String currency;

	@TableField(exist = false)
	private String email;

	@TableField(exist = false)
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal totalAssets;

	/**
	 * 充值类型（系统字典：user_fund_recharge_type）
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "充值类型（系统字典：user_fund_recharge_type）")
	private String type;

	/**
	 * 备注
	 */
	@TableField(exist = false)
	@ApiModelProperty(value = "备注")
	private String remark;

}
